import React from 'react'
import Tabs from '#tp/tabs/tabs'
// ===================================================================== Declare
const { $fn } = window
// ===================================================================== 
class Index extends React.Component{
	state = { 
		
	}
	
	render(){
		const { tabs, saveName, index } = this.props.top
		return (
			<>
				<Tabs
					data={ tabs }
					defaultActiveKey = { index }
					onTabs = { ({ status }, index) => {
						// 权限配置
						// const _index = oldTabs.findIndex( v => +v.status === +tabs[index].status )
						this.props.btnGroupRef().change(index)
						this.props.searchRef().change(status)
						this.props.tableRef().clear(status)
						this.props.top.way && this.props.top.tableRef2?.clear(status)
						this.props.tableRef().empty()
						this.props.top.way && this.props.top.tableRef2?.empty()
						$fn.local([ saveName ], index)
					}}
				/>
			</>
		)
	}
}

export default Index